<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
<meta charset="UTF-8">
<title>欢迎页面-X-admin2.2</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="stylesheet" href="HouTaiCss/css/font.css">
<link rel="stylesheet" href="HouTaiCss/css/xadmin.css">
<script src="HouTaiCss/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="HouTaiCss/js/xadmin.js"></script>
<!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>

<body>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a> <cite>异常情况记录添加</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			onclick="location.reload()" title="刷新"> <i
			class="layui-icon layui-icon-refresh" style="line-height: 30px"></i>
		</a>
	</div>
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md3"></div>
			<div class="layui-col-md6">
				<div class="layui-card">

					<div class="layui-card-body ">
						<h1>请如实录入信息</h1>
						<br/>
						<form class="layui-form" action="addEm" lay-filter="example"
							id="af" method="post">
							<div class="layui-form-item">
								<label class="layui-form-label">发生时间:</label>
								<div class="layui-input-block">
									<input type="date" name="occurrence_time" autocomplete="off"
										placeholder="请选择发生时间" class="layui-input"
										lay-verify="occurrence_time" style="width: 150px">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">车牌号:</label>
								<div class="layui-input-block">
									<input type="text" name="carNumber" placeholder="请输入车牌号"
										lay-verify="carNumber" autocomplete="off" class="layui-input"
										style="width: 150px">
								</div>
							</div>
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">事件原因:</label>
								<div class="layui-input-block">
									<textarea placeholder="请输入内容" class="layui-textarea"
										lay-verify="reason" name="reason"></textarea>
								</div>
							</div>
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">处理结果:</label>
								<div class="layui-input-block">
									<textarea placeholder="请输入内容" class="layui-textarea"
										lay-verify="result" name="result"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">处理人：</label>
								<div class="layui-input-block">
									<input type="text" name="adminName" placeholder="请输入处理人姓名"
										lay-verify="adminName" autocomplete="off" class="layui-input"
										style="width: 150px">
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-input-block">

									<button type="submit" class="layui-btn" lay-submit=""
										lay-filter="demo1">立即提交</button>


								</div>
							</div>
						</form>

					</div>
				</div>
			</div>
			<div class="layui-col-md3"></div>
		</div>
	</div>

	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

	<script>
		layui
				.use(
						[ 'form', 'layedit', 'laydate' ],
						function() {
							var form = layui.form, layer = layui.layer, layedit = layui.layedit, laydate = layui.laydate;

							//自定义验证规则
							form.verify({

								carNumber : function(value) {
									if (value.length != 7) {
										return '车牌应该为7位';
									}
								},

							});

							/* 
							 */

						
							form.on('submit(demo1)', function(data) {
								$.ajax({
									url : 'addEm',
									type : 'post',
									data : data.field,

									success : function(data) {
										if (data) {
											layer.alert("提交成功！")
										} else {
											layer.alert("提交失败！")
										}
									},
									error : function(e) {
										layer.alert("提交失败！")
									},

								});
								return false;
							}); 

							//表单取值
							/* 		layui.$('#LAY-component-form-getval').on('click',
											function() {
												var data = form.val('example');
												alert(JSON.stringify(data));
											}); */

						});
	</script>

</body>


</html>